package com.lvyq.qrobot;

/**
 * @author lvyq
 * @version 1.0
 * Create by 2024-06-26 9:17
 */
public class DoubleUtil {
    public static boolean isDecimal(double value) {
        return value != Math.floor(value) && value != Math.ceil(value);
    }

    public static void main(String[] args) {
        double[] values = {1.5, 2.0, -1.0, -2.5};
        for (double value : values) {
            System.out.println(value + " is decimal: " + isDecimal(value));
        }
    }
}